<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 500px;
            height: 200px;
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <button class="btn">洗</button>
    <div class="box1"></div>
    <div class="box2"></div>
    <script>
        var box1 = document.querySelector('.box1');
        var box2 = document.querySelector('.box2');
        var btn = document.querySelector('.btn');
        btn.onclick = function(){
            box1.innerHTML = '<h2>加拉法 </h2>';
            box2.innerText = '<h2>加拉法 </h2>';
            //1. innerText 不识别html标签 非标准  去除空格和换行
           // 2. innerHTML 识别html标签 W3C标准 保留空格和换行的
        }
    </script>
</body>
</html>